﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WinLogicUniversity
{
    public partial class winLogin : Form
    {
        public winLogin()
        {
            InitializeComponent();
        }

        private void panel1_Paint(object sender, PaintEventArgs e)
        {

        }

        private void btnLogin_Click(object sender, EventArgs e)
        {
              LogicUniversityT2Entities ct = new LogicUniversityT2Entities();
          
       
          
               InventoryUser i = ct.InventoryUsers.First<InventoryUser>(cust => cust.EmployeeID == txtUsername.Text);

                if (i != null)
                {

                    if (i.Password.ToString() == txtPassword.Text.ToString())
                    {


                        if (i.Role.ToString() == "Store clerk")

                       //     Response.Redirect("frmManageRequest.aspx");
                            MessageBox.Show("Hi Clerk!");

                        if (i.Role.ToString() == "Store Supervisor")
                        //    Response.Redirect("frmRequestStationery.aspx");
                           MessageBox.Show("Hi Supervisor!");

                    }
                //    else Label2.Text = "Wrong Password";



                }
            }

        private void winLogin_Load(object sender, EventArgs e)
        {

        } 

        }
    }

